#!/usr/bin/env python3
# -*-coding:utf-8 -*-
# __author__=LuLu
from page.basePage import BasePage
from pagesLocators.navigationLocators import NavigationLoc as Loc


class Navigation(BasePage):

    # 获取导航栏对象
    def find_navigation_bar(self):
        return self.find_element(Loc.navigation_main)

    # 获取导航栏文字
    def get_navigation_text(self):
        return self.get_element_value(self.find_navigation_bar())

    # 获取导航栏数量
    def get_navigation_num(self):
        return self.find_navigation_bar().size

    # 跳转会员列表
    def turn_to_member(self):
        self.click_navigation(Loc.member_bar_main, Loc.member_list)

    # 跳转分销列表
    def turn_to_distributor_list(self):
        self.click_navigation(Loc.distributor_bar_main, Loc.distributor_bar_list)

    # 跳转分销申请
    def turn_to_distributor_application(self):
        self.click_navigation(Loc.distributor_bar_main, Loc.distributor_bar_application)

    # 跳转攻略列表
    def turn_to_tourguide_list(self):
        self.click_navigation(Loc.tourguide_bar_main, Loc.tourguide_list)

    # 跳转攻略目的地
    def turn_to_tourguide_destination(self):
        self.click_navigation(Loc.tourguide_bar_main, Loc.tourguide_destination)

    # 跳转攻略话题
    def turn_to_tourguide_topic(self):
        self.click_navigation(Loc.tourguide_bar_main, Loc.tourguide_topic)

    # 跳转攻略主题
    def turn_to_tourguide_theme(self):
        self.click_navigation(Loc.tourguide_bar_main, Loc.tourguide_theme)

    # 跳转攻略预览
    def turn_to_preview(self):
        self.click_navigation(Loc.tourguide_bar_main, Loc.tourguide_preview)

    # 跳转食材推荐列表
    def turn_to_food_recommended_list(self):
        self.click_navigation(Loc.food_main, Loc.food_recommended_list)

    # 跳转食材目的地
    def turn_to_food_destination(self):
        self.click_navigation(Loc.food_main, Loc.food_destination)

    # 跳转订单
    def turn_to_order(self):
        self.click_navigation(Loc.order_main, Loc.order_tourguide)

    # 获取跳转后页面title
    def get_turn_to_after_title(self):
        return self.get_element_value(Loc.page_title)
